﻿#region 命名空间

using System;
using System.Collections.Generic;
using System.ServiceModel;
using Sharp.DataTransferObject;
using Sharp.Domain.PlatformBoundedContext.PermissionModule.Aggregates;
using Sharp.Infrastructure;
using Sharp.Infrastructure.Interfaces;

#endregion

namespace Sharp.ServiceContracts
{
    public partial interface IUserService
    {
        /// <summary>
        ///     全部权限
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof (FaultData))]
        IEnumerable<PermissionDTO> AllPermissions();

        /// <summary>
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof (FaultData))]
        IEnumerable<PermissionDTO> GetPermissionByGroupId(Guid guid);

        /// <summary>
        ///     保存权限
        /// </summary>
        /// <param name="ids">被勾选的权限列表</param>
        /// <param name="owner">所有者</param>
        /// <param name="ownerId">所有者id</param>
        /// <remarks>通过所有者来判断具体是给用户或者用户组进行权限配置</remarks>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof (FaultData))]
        Result SavePermission(IList<Guid> ids, string owner, Guid ownerId);

        /// <summary>
        ///     获取用户的权限
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof (FaultData))]
        IEnumerable<PermissionDTO> GetPermissionById(Guid uid);
        /// <summary>
        /// 更新权限库
        /// </summary>
        /// <param name="dtos"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(FaultData))]
        Result UpdatePermission(IList<PermissionDTO> dtos);
    }
}